// ------------------------------------------------------ Naming ------------------------------------------------------
Name Saab JAS 39C Gripen
ShortName JAS_39C
// ------------------------------------------------------ Visuals ------------------------------------------------------
Icon iconjas39c
Model sweden.jas39c
Texture jas39c
//Third Person Camera Distance
CameraDistance 20.0
//Resting Pitch. Set this so the plane spawns level. It will fall onto its collision boxes automatically, but this lets you start it flat
RestingPitch 0
HasGear True
ModelScale 1
// ------------------------------------------------------ Movement ------------------------------------------------------
//Mode : One of Plane, Heli or VTOL. The VTOL has a toggle button that switches some model aesthetics and the flight mode
Mode Plane
//Throttle
MaxThrottle 0.85
MaxNegativeThrottle 0.0
//Yaw modifiers
TurnLeftSpeed 2
TurnRightSpeed 2
//Pitch modifiers
LookUpSpeed 2.8
LookDownSpeed 2.8
//Roll modifiers
RollLeftSpeed 2.8
RollRightSpeed 2.8
//Drag 1.0 is standard. Modify to make the plane / heli more or less sluggish
Drag 0.6
//Lift
//Lift 2.5
//Wheels
NumWheels 3
WheelPosition 0 -48 -10 -26
WheelPosition 1 -48 -10 26
WheelPosition 2 62 -10 0
WheelSpringStrength 0.125
//Propeller <ID> <x> <y> <z> <planePart> <recipeItem>
Propeller 0 54 0 0 core metalPropeller
// ------------------------------------------------------ Weaponry ------------------------------------------------------
//Weapon types. Options are Missile, Bomb, Gun, Shell, None
Primary Missile
Secondary Bomb
//Time between shots in 1/20ths of seconds
ShootDelayPrimary 10
ShootDelaySecondary 10
//Whether to alternate or fire all together
AlternatePrimary False
AlternateSecondary False
//Firing modes. One of SemiAuto, FullAuto or Minigun
ModePrimary SemiAuto
ModeSecondary SemiAuto
//Add shoot origins. These are the points on your vehicle from which bullets / missiles / shells / bombs appear
ShootPointPrimary 5 13 -42 leftWing
ShootPointPrimary -15 13 -63 leftWing
ShootPointPrimary -35 27 -95 leftWing
ShootPointPrimary 5 13 42 rightWing
ShootPointPrimary -15 13 63 rightWing
ShootPointPrimary -35 27 95 rightWing
ShootPointSecondary 19 5 -15 core
ShootPointSecondary 19 5 15 core
// ------------------------------------------------------ Inventory ------------------------------------------------------
CargoSlots 0
BombSlots 2
MissileSlots 8
AllowAllAmmo True
AddAmmo AIM-9
AddAmmo AIM-120
AddAmmo GBU-12
AddAmmo largeBomb
AddAmmo smallBomb
AddAmmo napalm
//Fuel Tank Size (1 point of fuel will keep one propeller going with throttle at 1 for 1 tick)
FuelTankSize 6000
// ------------------------------------------------------ Passengers ------------------------------------------------------
Pilot 59 23 0
Passengers 0
// ------------------------------------------------------ Sounds ------------------------------------------------------
StartSound PlaneA
StartSoundLength 60
PropSound JetEngine1
PropSoundLength 3
ShootSoundPrimary RocketFire2
ShootSoundSecondary Bomb
// ------------------------------------------------------ Recipe ------------------------------------------------------
//Each section of the plane may have many parts
//The sections are tailWheel, tail, bay, topWing, leftWingWheel, leftWing, rightWingWheel,
//rightWing, nose, turret, coreWheel, core
AddRecipeParts core 1 advancedMetalCockpit
AddRecipeParts coreWheel 2 wheel
AddRecipeParts nose 1 metalNose
AddRecipeParts rightWing 1 metalWingSmall
AddRecipeParts leftWing 1 metalWingSmall
AddRecipeParts tail 1 metalTail
AddRecipeParts rightWingWheel 1 wheel
AddRecipeParts leftWingWheel 1 wheel
//Dye colours are "black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"
AddDye 5 white
AddDye 1 gray
// ------------------------------------------------------ Health and hitboxes ------------------------------------------------------
SetupPart core 40 50 24 -5 10 20 10
SetupPart airframe 300 -45 12 -11 148 38 22
SetupPart tail 100 -145 7 -33 99 76 66
SetupPart leftWing 135 -96 14 31 109 20 79
SetupPart rightWing 135 -96 14 -110 109 20 79
BulletDetection 4

//RightWing
CollisionPoint -43 28 -18 rightWing
CollisionPoint -43 28 -101 rightWing
CollisionPoint -3 28 -18 rightWing
CollisionPoint -3 28 -101 rightWing
//LeftWing
CollisionPoint -43 28 18 leftWing
CollisionPoint -43 28 101 leftWing
CollisionPoint -3 28 18 leftWing
CollisionPoint -3 28 101 leftWing
//Nose
CollisionPoint 81 28 0 core
CollisionPoint 46 28 0 core
CollisionPoint 81 28 0 core
CollisionPoint 46 28 0 core
CollisionPoint 81 28 0 core
CollisionPoint 46 28 0 core
CollisionPoint 81 28 0 core
CollisionPoint 46 28 0 core

//Tail
CollisionPoint -134 29 0 tail
ModelScale 1

BulletSpeed 3.5
BulletSpread 1

IsExplosionWhenDestroyed true
CollisionDamageEnable true
CollisionDamageThrottle 0.21
CollisionDamageTimes 50


hasPlaneRadar true
radarPositionOffset 20
radarRange 2000
radarVisible true 
radarRefreshDelay 10

ShootParticlesPrimary cloud 0 0 0
ShootParticlesSecondary cloud 1 0 0
ShootParticlesSecondary cloud -1 0 0
ShootParticlesSecondary explode -1 0 0
ShootParticlesSecondary flame -1 0 0

ReloadSoundPrimary PG_reload
ReloadTimePrimary 60
ReloadTimeSecondary 120
ReloadSoundSecondary PlaneBomb_reload1

EngineSoundRange 1000

HasFlare True
FlareDelay 360
FlareSound Flare
TimeFlareUsing 5
LockedOnSound Lock
SoundTime 8
LockedOnSoundRange 15

//max speeds sea level and high alt when afterburning or WEPing
maxSpeed 1.8
highAltMax 2.72

//max speeds sea level and high alt when not afterburning dry thrust cruise speed
maxSpeedDry 1.4
highAltMaxDry 1.5

//max speed during a high energy death dive
diveBonus 3.0
//max speed when dying from low energy stall climb
stallSuffering 1

//bonus multiplier for gaining energy while diving
energyGainRate 1.5

//how fast energy is lost multiplier
energyLossRate 1.0

//flight ceiling
flightCeiling 1500

//maneuvrability multipliers applied when max energy, if low energy defaults to just x1  you can also use 0.x to simulate controls locking up at high speed
rollBonus 1.2
yawBonus 1.2
pitchBonus 1.5

//maneuvrability multiplier when low energy stall
rollStall 0.8
yawStall 0.8
pitchStall 0.7

hasAfterBurner true
//use this to rename afterburner to WEP or 110% throttle or Notleistung or whatever


//afterburner particle emitter
AddEmitter flansmod.fmsmoke 1 [-155,30,0] [1,1,1] [-4,0,0] 0.5 0.8 0 1 tail
AddEmitter flansmod.fmflame 1 [-155,30,0] [3,1,1] [-1,0,0] 0.5 0.8 0 1 tail

//multiplier to fuel consumption when afterburner on
afterBurnFuelPenalty 3